package com.sg.hms.ServiceImpl;

import com.sg.hms.Dao.XianshiApplicationDao;
import com.sg.hms.DaoImpl.XianshiApplicationDaoImpl;
import com.sg.hms.Service.XianshiApplicationService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class XianshiApplicationServiceImpl implements XianshiApplicationService{
    XianshiApplicationDao xianshiappdao = new XianshiApplicationDaoImpl();
	@Override
	public JSONObject xianshiEmployeesSer(int start, int pageSize, int elId) {
		// TODO Auto-generated method stub
		JSONObject appli = new JSONObject();
		appli.put("total", xianshiappdao.ApplicationCount(elId));
		appli.put("rows", JSONArray.fromObject(xianshiappdao.xianshiApplication(start, pageSize)));
		return appli;
	}
	@Override
	public JSONObject xianshiEmployeesSer(int start, int pageSize, int elId, String elName,String dName) {
		// TODO Auto-generated method stub
		JSONObject appli = new JSONObject();
		appli.put("total", xianshiappdao.ApplicationCount(elId,elName,dName));
		appli.put("rows", JSONArray.fromObject(xianshiappdao.xianshiApplication(start, pageSize,elName,dName)));
		return appli;
	}
	@Override
	public String findElName() {
		// TODO Auto-generated method stub
		return xianshiappdao.findHouqinzhuguanName();
	}
	@Override
	public JSONObject FenleichakanSer(int start, int pageSize,int elId, String state) {
		// TODO Auto-generated method stub
		JSONObject appli = new JSONObject();
		appli.put("total", xianshiappdao.fenleichakanCount(elId, state));
		appli.put("rows", JSONArray.fromObject(xianshiappdao.fenleichakan(start, pageSize,state)));
		return appli;
	}

}
